import { request, HttpMethod, restartTimes, RequestConfig } from './request'
// BMI管理相关操作

export const getBMI = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/patientBmiMana/get_height_weight_bmi`,
    method: HttpMethod.GET,
    data: {
      patientUid: patientUid,
    }
  }
  return request(config);
}

export const getStatus = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/patientBmiMana/${patientUid}/status`,
    method: HttpMethod.GET,
    data: {
      patientUid: patientUid,
    }
  }
  return request(config);
}

export const getRecord = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/patientBmiMana/get_lastest_seven_bmi`,
    method: HttpMethod.GET,
    data: {
      patientUid: patientUid,
    }
  }
  return request(config);
}

export const addBMI = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/patientBmiMana`,
    method: HttpMethod.POST,
    data: data
  }
  return request(config);
}